﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;

namespace IHISCETeim.Web.MachineSys.FXModel
{
    public partial class FXFinanceLeaseAdd : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.新增 };
            }
        }
        protected override string DWZRef
        {
            get { return "FXFinanceLeaseMasterList"; }
        }

        
        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetRequestValue<string>("ajaxmethod", "") == "add")
            {
                addmenu();
                
            }
        }
        private void addmenu()
        {
            FXFinanceLeaseInfo obj = Request.SerializableObject<FXFinanceLeaseInfo>();
            obj.UserId = base.User.UserId;
            obj.RealName = base.User.RealName;
          //  obj.ORemark = obj.ORemark.Trim();
            //obj.AliasName = GetRequestValue<string>("dwz.orgLookup.AgentName", "");

            // obj.UserName = GetRequestValue<string>("dwz_orgLookup.UserName", "");
            int r = FXFinanceLeaseController.Add(obj);

            AddLog(Permission.新增, obj);

            if (r > 0)
                SuccessJson("新增成功");
            else
            {

                ErrorJson("新增失败");
            }
        }
    }
}